#coding:utf-8
import pymysql


import pandas as pd
import csv
import re
import numpy as np
from datetime import datetime

# 打开数据库连接
db = pymysql.connect(host="localhost", user="root", password="hui123456", db='dbtest')
# 使用cursor()方法创建一个游标对象cursor
cursor = db.cursor()
# 使用execute()方法执行SQL查询
#cursor.execute("create database dbtest charset=utf8;")
# 使用 fetchone() 方法获取单条数据


sql="""
    select day ,shop, order1, order2, Product_ID ,Product_xg,daren_id,daren,Product_num, Product_price , yh_pingtai, yh_daren, Product_BianMa, order_zt, order_sh from doudian_2024 where 
    daren_id="69526924387"  or   daren_id="62605402536"

    """
cursor.execute(sql)
result=cursor.fetchall()



xs=pd.DataFrame(list(result))

xs.to_excel(r'G:\结果\张喜喜1.xlsx')